#!/bin/bash

if [ -a last_log_filename ]; then
    echo Server is running.
    exit 1
fi

log_filename=logs/$(date +%Y.%m.%d_%H.%M.%S).log
echo $log_filename > last_log_filename

mkdir -p logs
git log | head -n 1 > $log_filename
nohup ./main.py >> $log_filename 2>&1 &